package com.example.springbootdemo.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class TestAdvice {

    @Pointcut("execution(* com.example.springbootdemo.aop.Test.*(..))")
    private void testAdvicePointCut() {
    }

    @Around("testAdvicePointCut()")
    public Object arount(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("前");
        Object result = joinPoint.proceed();
        System.out.println("后");
        return result;
    }
}
